package com.zcaxer.way.building;

public abstract class Building1 {
    public enum BuildingType {
        Food("兽场"), Wood("树林"), Grass("药园"), Iron("矿坑");

        private String name;
        private BuildingType(String name){
            this.name=name;
        }

        public String getStr() {
            return name;
        }
    }

    protected BuildingType type;
    protected int level=1;
    protected int workers=0;
    protected int maxWorkers=0;
    protected int foodIncrease=0;
    protected int capacity=0;
    protected int reserve=0;
    protected int upWoodNeed = 0;

    public Building1(BuildingType type, int level) {
        this.type = type;
        this.level = level;
        this.calculateData();
    }

    public void setLevel(int level){
        this.level=level;
        calculateData();
    }

    public void upgrade() {
        level += 1;
        calculateData();
    }

    public void setWorkers(int workers) {
        this.workers = workers;
    }

    public void setReserve(int reserve) {
        this.reserve = reserve;
    }

    protected abstract void calculateData();


}
